package com.zmn.oms.services.interfaces.fcorderpart;

import com.zmn.oms.common.exception.OmsBaseException;
import com.zmn.oms.model.dto.fcorderpart.FcOrderPartCheckDTO;
import com.zmn.oms.model.entity.fcorderpart.FcOrderPartQuery;
import com.zmn.oms.model.entity.fcorderpart.OrderFactoryPart;

import java.util.List;

/**
 * 类描述：厂商订单配件
 *
 * @author liuying
 * @date 2018/11/06 11:40
 */
public interface OrderFactoryPartService {

    /**
     * 根据主键查询
     * @param fcOrderPartId
     * @return
     */
    OrderFactoryPart findByKey(Integer fcOrderPartId);

    /**
     * 通过主键批量查询
     * @param ids
     * @return
     */
    List<OrderFactoryPart> listByIds(List<Integer> ids);
    /**
     * 通过订单id集合查询厂商订单配件
     * @param orderIdList
     * @return
     */
    List<OrderFactoryPart> listEsOrderFactoryPartByOrderIdList(List<Long> orderIdList);

    /**
     * 通过订单id查询厂商配件
     * @param orderId
     * @return
     */
    List<OrderFactoryPart> listOrderFactoryPartByOrderId(Long orderId);

    /**
     * 通过订单id和申请方式查询厂商配件
     * @param orderId
     * @param applyType
     * @return
     */
    List<Integer> listIdPartByOrderIdAndApplyType(Long orderId, Integer applyType);

    /**
     * 修改单条数据
     * @param orderFactoryPart
     */
    void update(OrderFactoryPart orderFactoryPart);

    /**
     * 批量更新
     * @param orderFactoryPart
     */
    void updateBatch(List<OrderFactoryPart> orderFactoryPart);

    /**
     * 根据订单id查询配件数量
     *
     * @param orderId
     * @return
     */
    int countByOrderId(Long orderId);

    /**
     * 通过订单Id删除
     * @param orderId
     */
    void deleteByOrderId(Long orderId);

    /**
     * 通过主键删除
     * @param fcOrderPartId
     */
    void deleteByKey(Integer fcOrderPartId);

    /**
     * 通过主键批量删除
     * @param idList 
     * @return void
     * @author wangxiaokun
     */
    void deleteByFcOrderPartIds(List<Integer> idList);

    /**
     * 申请厂家配件
     * @param orderFactoryParts
     * @return
     */
    void addFactoryPartList(List<OrderFactoryPart> orderFactoryParts);

    /**
     * 申请厂家配件
     * @param part
     * @return
     */
    int addFactoryPart(OrderFactoryPart part);

    /**
     * 通过orderId查询厂家配件
     * @param orderId
     * @return
     */
    List<OrderFactoryPart> listByOrderId(Long orderId);

    /**
     * 查询分页列表
     * @param fcOrderPartQuery
     * @return
     */
    List<OrderFactoryPart> listPageByQuery(FcOrderPartQuery fcOrderPartQuery);

    /**
     * 查询列表
     * @param fcOrderPartQuery
     * @return
     */
    List<OrderFactoryPart> listByQuery(FcOrderPartQuery fcOrderPartQuery);

    /**
     * 厂家配件检查
     * @param orderId
     * @return
     */
    FcOrderPartCheckDTO doFactoryPartCheck(Long orderId) throws OmsBaseException;

}
